package com.example.cfhkmanageapi.utils;


import com.example.cfhkmanageapi.entity.EmployeeVO;

/**
 * @description: 获取当前登录用户
 * @author: zcy
 * @create: 2020-04-01 10:24
 **/
public class LoginUserUtil {
    private static final ThreadLocal<EmployeeVO> loginUser = new ThreadLocal<>();

    public static EmployeeVO getLoginUser() {
        return loginUser.get();
    }

    public static void setLoginUser(EmployeeVO employeeVO) {
        if (employeeVO != null) {
            loginUser.set(employeeVO);
        }
    }

    public static void removeLoginUser() {
        loginUser.remove();
    }

}
